
<script type="text/javascript" src="__PUBLIC__/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jQuery-jcDate.js"></script>
<script type="text/javascript" src="__PUBLIC__/layer/layer.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/form_v.css">

<style>
    input.error { border: 1px solid red; }
</style>
<script>
    $(function(){

        $("input.jcDate").jcDate({
            IcoClass : "jcDateIco",
            Event : "click",
            Speed : 100,
            Left : 0,
            Top : 28,
            format : "-",
            Timeout : 100
        });

        //步骤数
        $("input[name='step_num']").on('input',function(){

            var picExplain=parseInt($(this).val());
            var picCon='',giftCon='';

            for(var i=0;i<picExplain;i++){
                picCon+='<p><span class="reportTit">    </span><input type="text" class="inp" placeholder="请输入任务'+(i+1)+'要求..." name="step_claim'+(i+1)+'" id="img_remark'+(i+1)+'" title="请输入任务'+(i+1)+'要求" required></p>';
                giftCon+='<p><span class="reportTit">    </span><input type="text" class="inp" placeholder="请输入任务'+(i+1)+'奖励..." name="step_gift'+(i+1)+'" id="step_gift'+(i+1)+'" title="请输入任务'+(i+1)+'奖励" required></p>';

            }
            $('.stepMore').html(picCon+giftCon);

        })

        //体验攻略步骤数

        $("input[name='raiders_num']").on('input',function(){

            var picExplain=parseInt($(this).val());
            var raiders_explain='',raiders_picture = '';

            for(var i=0;i<picExplain;i++){
                raiders_explain+='<p><span class="reportTit">    </span><input type="text" class="inp" placeholder="请输入体验攻略'+(i+1)+'说明..." name="raiders_explain'+(i+1)+'" id="raiders_explain'+(i+1)+'" title="请输入体验攻略'+(i+1)+'说明" required></p>';
                raiders_picture+='<p><span class="reportTit">体验攻略'+(i+1)+'图片：</span><input type="file" class="inp" name="raiders_picture'+(i+1)+'" required title="请上传体验攻略'+(i+1)+'图片"></p>';

            }
            $('.raidersMore').html(raiders_explain+raiders_picture);

        })
    });
    function showRuleEx()
    {
        var content = '<p>*在体验过程中如有以下违规行为，将得不到U币奖励，严重者直接冻结帐号：</p>'+
                        '<p>1.创建试玩账号昵称、角色名称不得跟聚享游内容相关。</p>'+
                        '<p>2.严禁在投资平台里发表任何有关聚享游的话题，如“做任务、聚享游”等。</p>'+
                        '<p>3.不要在投资平台里发表诋毁商家的言论，如“垃圾平台、平台太烂、拿完奖励不投资”等。</p>'+
                        '<p>4.为了快速获取U币奖励，使用第三方软件进行注册投资。</p>'+
                        '<p>5.严禁注册多个聚享游账号参与平台注册或投资以非法获取U币奖励。</p>'+
                        '<p>6.不要在投资平台里推荐其他玩家加入聚享游，以免对合作商家造成影响。</p>';
        layer.open({
            type: 1,
            shade: false, //不显示遮罩
            title: '<span style="color: red">试玩规则事例：</span>(可拖动)',
            skin: 'layer-ext-moon', //不用边框
            area: ['700px', '200px'], //宽高
            content: content
        });
    }
</script>
<h1 class="sysPageHead">
    <span class="sysPageDot"><img src="__PUBLIC__/images/sysListIcon3.png"><span class="textHide">.</span></span>
    广告申报
</h1>

<div class="iotSysmCon" style="background:#fff">
    <!--  -->
    <form method="post" action="__ROOT__/index.php/Admin/Advertising/store" enctype="multipart/form-data" id="addAdvertisingForm" class="cmxform">
        <div class="reportCon picRelate ">
            <div class="reportBody">
                <div class="reportList"><span class="reportTit">广告名称：</span><input type="text" class="inp" name="advertising_name" id="title" placeholder="输入广告名称" title="请输入广告名称" required></div>
                <div class="reportList">
                    <span class="reportTit" >广告主网站logo：</span>
                    <input type="file" class="inp" name="logo" required title="广告主网站logo">
                </div>
                <div class="reportList"><span class="reportTit">预期年化收益率：</span><input type="text" class="inp" name="rate" placeholder="请输入预期年化收益率" title="请输入预期年化收益率" required></div>
                <div class="reportList"><span class="reportTit">起购金额：</span><input type="text" class="inp" name="money" placeholder="请输入起购金额" title="请输入起购金额" required></div>
                <div class="reportList"><span class="reportTit">平台名称：</span><input type="text" class="inp" name="platform" placeholder="请输入平台名称" title="请输入平台名称" required></div>
                <div class="reportList"><span class="reportTit">安全评级：</span><input type="text" class="inp" name="safe_rating" placeholder="请输入安全评级" title="请输入安全评级" required></div>
                <div class="reportList"><span class="reportTit">网站地址：</span><input type="text" class="inp" name="siteUrl" placeholder="请输入网站地址" title="请输入网站地址" required></div>
                <div class="reportList"><span class="reportTit">注册资金：</span><input type="text" class="inp" name="registered_capital" placeholder="请输入注册资金" title="请输入注册资金" required></div>
                <div class="reportList"><span class="reportTit">所在地区：</span><input type="text" class="inp" name="region" placeholder="请输入所在地区" title="请输入所在地区" required></div>
                <div class="reportList"><span class="reportTit">上线时间：</span><input type="text" class="inp jcDate" name="online_time" placeholder="请输入上线时间" title="请输入上线时间" required></div>
                <div class="reportList"><span class="reportTit">ICP备案：</span><input type="text" class="inp" name="icp" placeholder="请输入ICP备案" title="请输入ICP备案" required></div>
                <div class="reportList"><span class="reportTit">联系电话：</span><input type="text" class="inp" name="phone" placeholder="请输入联系电话" title="请输入联系电话" required></div>
                <div class="reportList"><span class="reportTit">服务邮箱：</span><input type="email" class="inp" name="service_email" placeholder="请输入服务邮箱" title="请输入服务邮箱" required></div>
                <div class="reportList"><span class="reportTit">公司信息：</span><textarea class="inp" name="company_info" required title="请输入公司信息" placeholder="请输入公司信息"></textarea></div>
                <div class="reportList"><span class="reportTit">立即体验跳转地址：</span><input type="text" class="inp" name="jump_url" placeholder="请输入立即体验跳转地址" title="请输入立即体验跳转地址" required></div>
                <div class="reportList">
                    <span class="reportTit">介绍图片：</span>
                    <input type="file" class="inp" name="introduce_picture" required title="请上传介绍图片">
                </div>
                <div class="reportList"><span class="reportTit">温馨提示：</span><textarea class="inp" name="prompt" required placeholder="请输入温馨提示" title="请输入温馨提示"></textarea></div>
                <div class="reportList"><span class="reportTit">体验时间：</span><input type="text" class="inp jcDate" name="experience_time" placeholder="请输入体验时间" title="请输入体验时间" required></div>
                <div class="reportList"><span class="reportTit">发送方式：</span><input type="text" class="inp" name="send_method" placeholder="请输入发送方式" title="请输入发送方式" required></div>
                <div class="reportList"><span class="reportTit">步骤数：</span><input type="text" class="inp" name="step_num" placeholder="请输入步骤数" title="请输入步骤数" required></div>

                <div class="reportList">
                    <div class="stepMore">

                    </div>
                </div>
                <div class="reportList"><span class="reportTit">体验攻略步骤数：</span><input type="text" class="inp" name="raiders_num" placeholder="请输入体验攻略步骤数" title="请输入体验攻略步骤数" required></div>

                <div class="reportList">
                    <div class="raidersMore">

                    </div>
                </div>

                <div class="reportList"><span class="reportTit">试玩规则：</span>
                    <textarea class="inp" name="rule" required placeholder="请输入试玩规则" title="请输入试玩规则"></textarea>&nbsp;<a href="javascript:void (0)" onclick="showRuleEx()">填写规则请参照此处</a>
                </div>
                <div class="reportList"><span class="reportTit">广告类型：</span>
                    <select name="type" id="type" class="inp" required title="请选择广告类型" style="width: 810px">
                        <option value="">请选择</option>
                        <foreach name="ad_types" item="val" key="key">
                            <option value="{$key}">{$val}</option>
                        </foreach>
                    </select>
                    <label id="type-error" class="error" for="type"></label>
                    <!--<input type="text" class="inp" name="type" placeholder="请输入广告类型" title="请输入广告类型" required>-->
                </div>
                <div class="reportList"><span class="reportTit">广告结算步骤数：</span><input type="text" class="inp" name="clearing_num" placeholder="请输入广告结算步骤数" title="请输入广告结算步骤数" required></div>
                <div class="reportList"><span class="reportTit">广告单价：</span><input type="text" class="inp" name="unit_price" placeholder="请输入广告单价" title="请输入广告单价" required></div>
                <div class="reportList"><span class="reportTit">广告总金额：</span><input type="text" class="inp" name="total_amount" placeholder="请输入广告总金额" title="请输入广告总金额" required></div>
                <div class="reportList"><span class="reportTit">广告消耗报警比例：</span><input type="text" class="inp" name="alarm_rate" placeholder="请输入广告消耗报警比例" title="请输入广告消耗报警比例" required></div>
                <div class="reportList"><span class="reportTit">ROI注册与投资转化率：</span><input type="text" class="inp" name="roi" placeholder="请输入ROI注册与投资转化率" title="请输入ROI注册与投资转化率" required></div>
                <div class="reportList"><span class="reportTit">特殊说明：</span><textarea class="inp" name="note" required placeholder="请输入特殊说明" title="请输入特殊说明"></textarea></div>
                <div class="reportList"><p class="subBtn" style="margin-top:15px;padding-left:155px"><input type="submit" value="创建" class="modifyBtn"></p></div>
            </div>
        </div>
    </form>
</div>


<script>
    $(function() {
        //验证表单
        $("#addAdvertisingForm").validate();
    });
</script>